package com.heriparid.slideshow.paging;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class CustomViewPager extends ViewPager {

	private boolean mEnableToches = true;

	public CustomViewPager(Context context) {
		super(context);		
	}

	public CustomViewPager(Context context, AttributeSet attrs) {
		super(context, attrs);		
	}
	
	@Override
    public boolean onTouchEvent(MotionEvent event) {
        if (this.mEnableToches) {        	
            return super.onTouchEvent(event);
        }
  
        return false;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (this.mEnableToches) {
            return super.onInterceptTouchEvent(event);
        }
 
        return false;
    }
 
    public void setPagingEnabled(boolean enabled) {
        this.mEnableToches = enabled;
    }    
    
}